﻿using gbL.NetBoard.Examples.DoubleMVC;
using gbL.NetBoard.Examples.DoubleMVC.Controller;
using gbL.NetBoard.Examples.DoubleMVC.Model.Requests;
using NUnit.Framework;
using Rhino.Mocks;

namespace gbL.NetBoard.Examples.DoubleMVC.Tests
{
    [TestFixture]
    public class ProductsControllerTests
    {
        [Test]
        public void List_should_send_ProductListRequest()
        {
            // A
            Blackboard domain = new Blackboard();
            ProductsController target = new ProductsController(domain, MockRepository.GenerateStub<IInputSource>());
            // A
            target.List();
            // A
            Assert.That(domain.Read(), Has.Count.EqualTo(1));
            Assert.That(domain.Read()[0].Message, Is.InstanceOf<ProductListRequest>());
        }
    }
}